package com.kedacom.ctsp.authority.dao;

import com.kedacom.ctsp.authority.entity.Area;
import com.kedacom.ctsp.web.dao.CrudDao;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 区域 DAO接口
 *
 */
public interface AreaDao extends CrudDao<Area, String> {


    /**
     * 根据path模糊设置父节点及其子节点有效/无效update f_area set `status`=?2 where path like ?1%
     *
     * @param path
     * @return
     */
    @Modifying
    @Query(nativeQuery = true, value = "update f_area set status=?1 where path like ?2%")
    int updateAreaStatusByPathLike(int status,String path);




}
